<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>SSH 集群配置 | Hui</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="SSH 集群配置应用场景
1、在hadoop集群中，需要不同的机器能够免密登录集群中的机器，就需要SSH集群

1、单机免密登录
说明：服务器为centos，redhat,hadoop


1、安装SSH：  apt-get install ssh ```123&amp;gt; ssh 删除： ``` sudo apt-get autoremove ssh  ``` - 2、测试安装    ``` ss">
<meta property="og:type" content="article">
<meta property="og:title" content="SSH 集群配置">
<meta property="og:url" content="http://mhuihui.oschina.io/m-pages/2017/01/05/SSH 集群配置/index.html">
<meta property="og:site_name" content="Hui">
<meta property="og:description" content="SSH 集群配置应用场景
1、在hadoop集群中，需要不同的机器能够免密登录集群中的机器，就需要SSH集群

1、单机免密登录
说明：服务器为centos，redhat,hadoop


1、安装SSH：  apt-get install ssh ```123&amp;gt; ssh 删除： ``` sudo apt-get autoremove ssh  ``` - 2、测试安装    ``` ss">
<meta property="og:updated_time" content="2017-02-10T03:36:00.239Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="SSH 集群配置">
<meta name="twitter:description" content="SSH 集群配置应用场景
1、在hadoop集群中，需要不同的机器能够免密登录集群中的机器，就需要SSH集群

1、单机免密登录
说明：服务器为centos，redhat,hadoop


1、安装SSH：  apt-get install ssh ```123&amp;gt; ssh 删除： ``` sudo apt-get autoremove ssh  ``` - 2、测试安装    ``` ss">
  
    <link rel="alternate" href="/atom.xml" title="Hui" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/m-pages/css/style.css">
  

</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/m-pages/" id="logo">Hui</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/m-pages/">Home</a>
        
          <a class="main-nav-link" href="/m-pages/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://mhuihui.oschina.io/m-pages"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-SSH 集群配置" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/m-pages/2017/01/05/SSH 集群配置/" class="article-date">
  <time datetime="2017-01-05T12:11:38.000Z" itemprop="datePublished">2017-01-05</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      SSH 集群配置
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <hr>
<h2 id="SSH-集群配置"><a href="#SSH-集群配置" class="headerlink" title="SSH 集群配置"></a>SSH 集群配置</h2><h4 id="应用场景"><a href="#应用场景" class="headerlink" title="应用场景"></a>应用场景</h4><blockquote>
<p>1、在hadoop集群中，需要不同的机器能够免密登录集群中的机器，就需要SSH集群</p>
</blockquote>
<h5 id="1、单机免密登录"><a href="#1、单机免密登录" class="headerlink" title="1、单机免密登录"></a>1、单机免密登录</h5><blockquote>
<p>说明：服务器为centos，redhat,hadoop</p>
</blockquote>
<ul>
<li>1、安装SSH：  <figure class="highlight plain"><figcaption><span>apt-get install ssh ```</span></figcaption><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">&gt; ssh 删除： ``` sudo apt-get autoremove ssh  ``` </div><div class="line">- 2、测试安装</div><div class="line">    ``` ssh -p 22 root@hadoop1</div></pre></td></tr></table></figure>
</li>
</ul>
<blockquote>
<p>-p: 指明连接端口，默认为22</p>
<p>root: 为登录用户</p>
<p>hadoop1：为登录主机的IP或者主机名称</p>
</blockquote>
<ul>
<li>单机免密登录<blockquote>
<p>生成 keygen  <figure class="highlight plain"><figcaption><span>-t rsa``` id_rsa.pub 生成，加密方式为rsa</span></figcaption><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">&gt; 复制 id_rsa.pub 到 authorized_keys : ``` cp  id_rsa.pub authorized_keys</div></pre></td></tr></table></figure></p>
</blockquote>
</li>
</ul>
<blockquote>
<p>测试 ssh 单机免密登录 是否成功 <figure class="highlight plain"><figcaption><span>localhost ```</span></figcaption><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div></pre></td><td class="code"><pre><div class="line"></div><div class="line"></div><div class="line">##### 2、集群免密登录</div><div class="line"></div><div class="line">&gt; 服务器信息</div><div class="line"></div><div class="line">服务器名称  |IP |hosts |</div><div class="line">---|---|---|</div><div class="line">master|192.168.42.20|master|</div><div class="line">node1|192.168.42.21|node1|</div><div class="line">node2|192.168.42.22|node2|</div><div class="line"></div><div class="line">登录到 node1 开始执行下面的命令：</div><div class="line"></div><div class="line">```sheel</div><div class="line">cd ~	</div><div class="line">ls -a 	</div><div class="line">cd .ssh/ 	</div><div class="line">scp root@master:~/.ssh/id_rsa.pub ./master_rsa.pub 		</div><div class="line">cat master_rsa.pub &gt;&gt; authorized_keys 	</div><div class="line">more authorized_keys 	</div><div class="line"></div><div class="line">--------------------------------</div><div class="line">//切换到用户目录</div><div class="line">//列出所有的文件</div><div class="line">//进入 ssh 配置目录 </div><div class="line">//通过 scp 复制其他 服务器上的目录</div><div class="line">//将 master 的密钥 追加到 当前的 密钥文件中</div><div class="line">//查看是否 追加成功</div></pre></td></tr></table></figure></p>
</blockquote>
<p>登录到 master 机器 上：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">ssh node1</div></pre></td></tr></table></figure>
<blockquote>
<p>node2 的配置同理</p>
</blockquote>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://mhuihui.oschina.io/m-pages/m-pages/2017/01/05/SSH 集群配置/" data-id="ciyzazarz000gs8vgdbut6toy" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/m-pages/tags/linux/">linux</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/m-pages/2017/01/06/Ngrok配置详解/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          Ngrok 配置服务器
        
      </div>
    </a>
  
  
    <a href="/m-pages/2017/01/04/Spring 4.2新特性之-@Import/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Spring4.2新特性之Import</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/m-pages/tags/ide/">ide</a></li><li class="tag-list-item"><a class="tag-list-link" href="/m-pages/tags/linux/">linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/m-pages/tags/编程/">编程</a></li><li class="tag-list-item"><a class="tag-list-link" href="/m-pages/tags/设计/">设计</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/m-pages/tags/ide/" style="font-size: 13.33px;">ide</a> <a href="/m-pages/tags/linux/" style="font-size: 16.67px;">linux</a> <a href="/m-pages/tags/编程/" style="font-size: 20px;">编程</a> <a href="/m-pages/tags/设计/" style="font-size: 10px;">设计</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/m-pages/archives/2017/02/">February 2017</a></li><li class="archive-list-item"><a class="archive-list-link" href="/m-pages/archives/2017/01/">January 2017</a></li><li class="archive-list-item"><a class="archive-list-link" href="/m-pages/archives/2016/12/">December 2016</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/m-pages/2017/02/10/go语言学习笔记（四)/">go语言学习笔记（四）</a>
          </li>
        
          <li>
            <a href="/m-pages/2017/02/10/hello-world/">Hello World</a>
          </li>
        
          <li>
            <a href="/m-pages/2017/01/14/go语言学习笔记（三）/">go语言学习笔记（三）</a>
          </li>
        
          <li>
            <a href="/m-pages/2017/01/13/go语言学习笔记（二）/">go语言学习笔记（二）结构体和切片</a>
          </li>
        
          <li>
            <a href="/m-pages/2017/01/12/go语言学习笔记（一）/">go语言开发环境搭建</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2017 hui<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/m-pages/" class="mobile-nav-link">Home</a>
  
    <a href="/m-pages/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/m-pages/fancybox/jquery.fancybox.css">
  <script src="/m-pages/fancybox/jquery.fancybox.pack.js"></script>


<script src="/m-pages/js/script.js"></script>

  </div>
</body>
</html>